{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "db444d41",
   "metadata": {},
   "outputs": [],
   "source": [
    "from mpl_toolkits.axes_grid1 import make_axes_locatable\n",
    "from pyts.datasets import load_gunpoint\n",
    "from pyts.image import RecurrencePlot\n",
    "\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4f893991",
   "metadata": {},
   "outputs": [],
   "source": [
    "first_phase_oneperson = pd.read_csv('./first_phase_oneperson.csv')\n",
    "second_phase_oneperson = pd.read_csv('./second_phase_oneperson.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "90241478",
   "metadata": {},
   "outputs": [],
   "source": [
    "rp = RecurrencePlot()\n",
    "for i in range(first_phase_oneperson.values.shape[0]):\n",
    "    X_rp = rp.transform(np.array([first_phase_oneperson.values[i]]))\n",
    "    fig = plt.figure(figsize=(10, 10))\n",
    "    ax_rp = fig.add_subplot()\n",
    "    ax_rp.imshow(X_rp[0], cmap='binary')\n",
    "    plt.savefig(\"./img_data/相位上/\"+str(i)+\".png\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7692d806",
   "metadata": {},
   "outputs": [],
   "source": [
    "rp = RecurrencePlot()\n",
    "\n",
    "for i in range(second_phase_oneperson.values.shape[0]):\n",
    "    X_rp = rp.transform(np.array([second_phase_oneperson.values[i]]))\n",
    "    fig = plt.figure(figsize=(10, 10))\n",
    "    ax_rp = fig.add_subplot()\n",
    "    ax_rp.imshow(X_rp[0], cmap='binary')\n",
    "    plt.savefig(\"./img_data/相位下/\"+str(i)+\".png\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
